#include <iostream>
#include <conio.h>

//calculate 1 + 1/1! + 1/2! +...+ 1/n! n = 1,2.... n take to our

int main(){
	int n = 0;
	float sum = 0.0;
	float mul = 1.0;
	std::cout << "n = ";
	std::cin >> n;
	for (int i = 1 ; i <= n ; ++i){
		mul = mul * i;
		sum = sum + 1 / mul;
	}
	std::cout << "sum = " << sum << std::endl;
	getch();
	return 0;
}